#ifndef __DSFORMAT_H__
#define __DSFORMAT_H__

enum DsFormat {
	CHK_NULL_CHUNK             =0x0000,
	CHK_M3DMAGIC               =0x4D4D,    /*3DS file*/
	CHK_SMAGIC                 =0x2D2D,    
	CHK_LMAGIC                 =0x2D3D,    
	CHK_MLIBMAGIC              =0x3DAA,    /*MLI file*/
	CHK_MATMAGIC               =0x3DFF,    
	CHK_CMAGIC                 =0xC23D,    /*PRJ file*/
	CHK_M3D_VERSION            =0x0002,
	CHK_M3D_KFVERSION          =0x0005,

	CHK_COLOR_F                =0x0010,
	CHK_COLOR_24               =0x0011,
	CHK_LIN_COLOR_24           =0x0012,
	CHK_LIN_COLOR_F            =0x0013,
	CHK_INT_PERCENTAGE         =0x0030,
	CHK_FLOAT_PERCENTAGE       =0x0031,

	CHK_MDATA                  =0x3D3D,
	CHK_MESH_VERSION           =0x3D3E,
	CHK_MASTER_SCALE           =0x0100,
	CHK_LO_SHADOW_BIAS         =0x1400,
	CHK_HI_SHADOW_BIAS         =0x1410,
	CHK_SHADOW_MAP_SIZE        =0x1420,
	CHK_SHADOW_SAMPLES         =0x1430,
	CHK_SHADOW_RANGE           =0x1440,
	CHK_SHADOW_FILTER          =0x1450,
	CHK_RAY_BIAS               =0x1460,
	CHK_O_CONSTS               =0x1500,
	CHK_AMBIENT_LIGHT          =0x2100,
	CHK_BIT_MAP                =0x1100,
	CHK_SOLID_BGND             =0x1200,
	CHK_V_GRADIENT             =0x1300,
	CHK_USE_BIT_MAP            =0x1101,
	CHK_USE_SOLID_BGND         =0x1201,
	CHK_USE_V_GRADIENT         =0x1301,
	CHK_FOG                    =0x2200,
	CHK_FOG_BGND               =0x2210,
	CHK_LAYER_FOG              =0x2302,
	CHK_DISTANCE_CUE           =0x2300,
	CHK_DCUE_BGND              =0x2310,
	CHK_USE_FOG                =0x2201,
	CHK_USE_LAYER_FOG          =0x2303,
	CHK_USE_DISTANCE_CUE       =0x2301,

	CHK_MAT_ENTRY              =0xAFFF,
	CHK_MAT_NAME               =0xA000,
	CHK_MAT_AMBIENT            =0xA010,
	CHK_MAT_DIFFUSE            =0xA020,
	CHK_MAT_SPECULAR           =0xA030,
	CHK_MAT_SHININESS          =0xA040,
	CHK_MAT_SHIN2PCT           =0xA041,
	CHK_MAT_TRANSPARENCY       =0xA050,
	CHK_MAT_XPFALL             =0xA052,
	CHK_MAT_USE_XPFALL         =0xA240,
	CHK_MAT_REFBLUR            =0xA053,
	CHK_MAT_SHADING            =0xA100,
	CHK_MAT_USE_REFBLUR        =0xA250,
	CHK_MAT_SELF_ILLUM         =0xA080,
	CHK_MAT_TWO_SIDE           =0xA081,
	CHK_MAT_DECAL              =0xA082,
	CHK_MAT_ADDITIVE           =0xA083,
	CHK_MAT_SELF_ILPCT         =0xA084,
	CHK_MAT_WIRE               =0xA085,
	CHK_MAT_FACEMAP            =0xA088,
	CHK_MAT_PHONGSOFT          =0xA08C,
	CHK_MAT_WIREABS            =0xA08E,
	CHK_MAT_WIRE_SIZE          =0xA087,
	CHK_MAT_TEXMAP             =0xA200,
	CHK_MAT_SXP_TEXT_DATA      =0xA320,
	CHK_MAT_TEXMASK            =0xA33E,
	CHK_MAT_SXP_TEXTMASK_DATA  =0xA32A,
	CHK_MAT_TEX2MAP            =0xA33A,
	CHK_MAT_SXP_TEXT2_DATA     =0xA321,
	CHK_MAT_TEX2MASK           =0xA340,
	CHK_MAT_SXP_TEXT2MASK_DATA =0xA32C,
	CHK_MAT_OPACMAP            =0xA210,
	CHK_MAT_SXP_OPAC_DATA      =0xA322,
	CHK_MAT_OPACMASK           =0xA342,
	CHK_MAT_SXP_OPACMASK_DATA  =0xA32E,
	CHK_MAT_BUMPMAP            =0xA230,
	CHK_MAT_SXP_BUMP_DATA      =0xA324,
	CHK_MAT_BUMPMASK           =0xA344,
	CHK_MAT_SXP_BUMPMASK_DATA  =0xA330,
	CHK_MAT_SPECMAP            =0xA204,
	CHK_MAT_SXP_SPEC_DATA      =0xA325,
	CHK_MAT_SPECMASK           =0xA348,
	CHK_MAT_SXP_SPECMASK_DATA  =0xA332,
	CHK_MAT_SHINMAP            =0xA33C,
	CHK_MAT_SXP_SHIN_DATA      =0xA326,
	CHK_MAT_SHINMASK           =0xA346,
	CHK_MAT_SXP_SHINMASK_DATA  =0xA334,
	CHK_MAT_SELFIMAP           =0xA33D,
	CHK_MAT_SXP_SELFI_DATA     =0xA328,
	CHK_MAT_SELFIMASK          =0xA34A,
	CHK_MAT_SXP_SELFIMASK_DATA =0xA336,
	CHK_MAT_REFLMAP            =0xA220,
	CHK_MAT_REFLMASK           =0xA34C,
	CHK_MAT_SXP_REFLMASK_DATA  =0xA338,
	CHK_MAT_ACUBIC             =0xA310,
	CHK_MAT_MAPNAME            =0xA300,
	CHK_MAT_MAP_TILING         =0xA351,
	CHK_MAT_MAP_TEXBLUR        =0xA353,
	CHK_MAT_MAP_USCALE         =0xA354,
	CHK_MAT_MAP_VSCALE         =0xA356,
	CHK_MAT_MAP_UOFFSET        =0xA358,
	CHK_MAT_MAP_VOFFSET        =0xA35A,
	CHK_MAT_MAP_ANG            =0xA35C,
	CHK_MAT_MAP_COL1           =0xA360,
	CHK_MAT_MAP_COL2           =0xA362,
	CHK_MAT_MAP_RCOL           =0xA364,
	CHK_MAT_MAP_GCOL           =0xA366,
	CHK_MAT_MAP_BCOL           =0xA368,

	CHK_NAMED_OBJECT           =0x4000,
	CHK_N_DIRECT_LIGHT         =0x4600,
	CHK_DL_OFF                 =0x4620,
	CHK_DL_OUTER_RANGE         =0x465A,
	CHK_DL_INNER_RANGE         =0x4659,
	CHK_DL_MULTIPLIER          =0x465B,
	CHK_DL_EXCLUDE             =0x4654,
	CHK_DL_ATTENUATE           =0x4625,
	CHK_DL_SPOTLIGHT           =0x4610,
	CHK_DL_SPOT_ROLL           =0x4656,
	CHK_DL_SHADOWED            =0x4630,
	CHK_DL_LOCAL_SHADOW2       =0x4641,
	CHK_DL_SEE_CONE            =0x4650,
	CHK_DL_SPOT_RECTANGULAR    =0x4651,
	CHK_DL_SPOT_ASPECT         =0x4657,
	CHK_DL_SPOT_PROJECTOR      =0x4653,
	CHK_DL_SPOT_OVERSHOOT      =0x4652,
	CHK_DL_RAY_BIAS            =0x4658,
	CHK_DL_RAYSHAD             =0x4627,
	CHK_N_CAMERA               =0x4700,
	CHK_CAM_SEE_CONE           =0x4710,
	CHK_CAM_RANGES             =0x4720,
	CHK_OBJ_HIDDEN             =0x4010,
	CHK_OBJ_VIS_LOFTER         =0x4011,
	CHK_OBJ_DOESNT_CAST        =0x4012,
	CHK_OBJ_DONT_RCVSHADOW     =0x4017,
	CHK_OBJ_MATTE              =0x4013,
	CHK_OBJ_FAST               =0x4014,
	CHK_OBJ_PROCEDURAL         =0x4015,
	CHK_OBJ_FROZEN             =0x4016,
	CHK_N_TRI_OBJECT           =0x4100,
	CHK_POINT_ARRAY            =0x4110,
	CHK_POINT_FLAG_ARRAY       =0x4111,
	CHK_FACE_ARRAY             =0x4120,
	CHK_MSH_MAT_GROUP          =0x4130,
	CHK_SMOOTH_GROUP           =0x4150,
	CHK_MSH_BOXMAP             =0x4190,
	CHK_TEX_VERTS              =0x4140,
	CHK_MESH_MATRIX            =0x4160,
	CHK_MESH_COLOR             =0x4165,
	CHK_MESH_TEXTURE_INFO      =0x4170,

	CHK_KFDATA                 =0xB000,
	CHK_KFHDR                  =0xB00A,
	CHK_KFSEG                  =0xB008,
	CHK_KFCURTIME              =0xB009,
	CHK_AMBIENT_NODE_TAG       =0xB001,
	CHK_OBJECT_NODE_TAG        =0xB002,
	CHK_CAMERA_NODE_TAG        =0xB003,
	CHK_TARGET_NODE_TAG        =0xB004,
	CHK_LIGHT_NODE_TAG         =0xB005,
	CHK_L_TARGET_NODE_TAG      =0xB006,
	CHK_SPOTLIGHT_NODE_TAG     =0xB007,
	CHK_NODE_ID                =0xB030,
	CHK_NODE_HDR               =0xB010,
	CHK_PIVOT                  =0xB013,
	CHK_INSTANCE_NAME          =0xB011,
	CHK_MORPH_SMOOTH           =0xB015,
	CHK_BOUNDBOX               =0xB014,
	CHK_POS_TRACK_TAG          =0xB020,
	CHK_COL_TRACK_TAG          =0xB025,
	CHK_ROT_TRACK_TAG          =0xB021,
	CHK_SCL_TRACK_TAG          =0xB022,
	CHK_MORPH_TRACK_TAG        =0xB026,
	CHK_FOV_TRACK_TAG          =0xB023,
	CHK_ROLL_TRACK_TAG         =0xB024,
	CHK_HOT_TRACK_TAG          =0xB027,
	CHK_FALL_TRACK_TAG         =0xB028,
	CHK_HIDE_TRACK_TAG         =0xB029,

	CHK_POLY_2D                = 0x5000,
	CHK_SHAPE_OK               = 0x5010,
	CHK_SHAPE_NOT_OK           = 0x5011,
	CHK_SHAPE_HOOK             = 0x5020,
	CHK_PATH_3D                = 0x6000,
	CHK_PATH_MATRIX            = 0x6005,
	CHK_SHAPE_2D               = 0x6010,
	CHK_M_SCALE                = 0x6020,
	CHK_M_TWIST                = 0x6030,
	CHK_M_TEETER               = 0x6040,
	CHK_M_FIT                  = 0x6050,
	CHK_M_BEVEL                = 0x6060,
	CHK_XZ_CURVE               = 0x6070,
	CHK_YZ_CURVE               = 0x6080,
	CHK_INTERPCT               = 0x6090,
	CHK_DEFORM_LIMIT           = 0x60A0,

	CHK_USE_CONTOUR            = 0x6100,
	CHK_USE_TWEEN              = 0x6110,
	CHK_USE_SCALE              = 0x6120,
	CHK_USE_TWIST              = 0x6130,
	CHK_USE_TEETER             = 0x6140,
	CHK_USE_FIT                = 0x6150,
	CHK_USE_BEVEL              = 0x6160,

	CHK_DEFAULT_VIEW           = 0x3000,
	CHK_VIEW_TOP               = 0x3010,
	CHK_VIEW_BOTTOM            = 0x3020,
	CHK_VIEW_LEFT              = 0x3030,
	CHK_VIEW_RIGHT             = 0x3040,
	CHK_VIEW_FRONT             = 0x3050,
	CHK_VIEW_BACK              = 0x3060,
	CHK_VIEW_USER              = 0x3070,
	CHK_VIEW_CAMERA            = 0x3080,
	CHK_VIEW_WINDOW            = 0x3090,

	CHK_VIEWPORT_LAYOUT_OLD    = 0x7000,
	CHK_VIEWPORT_DATA_OLD      = 0x7010,
	CHK_VIEWPORT_LAYOUT        = 0x7001,
	CHK_VIEWPORT_DATA          = 0x7011,
	CHK_VIEWPORT_DATA_3        = 0x7012,
	CHK_VIEWPORT_SIZE          = 0x7020,
	CHK_NETWORK_VIEW           = 0x7030
};

/*
 MAIN3DS  (0x4D4D)
                  |
                  +--EDIT3DS  (0x3D3D)
                  |  |
                  |  +--EDIT_MATERIAL (0xAFFF)
                  |  |  |
                  |  |  +--MAT_NAME01 (0xA000) (See mli Doc) 
                  |  |
                  |  +--EDIT_CONFIG1  (0x0100)
                  |  +--EDIT_CONFIG2  (0x3E3D) 
                  |  +--EDIT_VIEW_P1  (0x7012)
                  |  |  |
                  |  |  +--TOP            (0x0001)
                  |  |  +--BOTTOM         (0x0002)
                  |  |  +--LEFT           (0x0003)
                  |  |  +--RIGHT          (0x0004)
                  |  |  +--FRONT          (0x0005) 
                  |  |  +--BACK           (0x0006)
                  |  |  +--USER           (0x0007)
                  |  |  +--CAMERA         (0xFFFF)
                  |  |  +--LIGHT          (0x0009)
                  |  |  +--DISABLED       (0x0010)  
                  |  |  +--BOGUS          (0x0011)
                  |  |
                  |  +--EDIT_VIEW_P2  (0x7011)
                  |  |  |
                  |  |  +--TOP            (0x0001)
                  |  |  +--BOTTOM         (0x0002)
                  |  |  +--LEFT           (0x0003)
                  |  |  +--RIGHT          (0x0004)
                  |  |  +--FRONT          (0x0005) 
                  |  |  +--BACK           (0x0006)
                  |  |  +--USER           (0x0007)
                  |  |  +--CAMERA         (0xFFFF)
                  |  |  +--LIGHT          (0x0009)
                  |  |  +--DISABLED       (0x0010)  
                  |  |  +--BOGUS          (0x0011)
                  |  |
                  |  +--EDIT_VIEW_P3  (0x7020)
                  |  +--EDIT_VIEW1    (0x7001) 
                  |  +--EDIT_BACKGR   (0x1200) 
                  |  +--EDIT_AMBIENT  (0x2100)
                  |  +--EDIT_OBJECT   (0x4000)
                  |  |  |
                  |  |  +--OBJ_TRIMESH   (0x4100)      
                  |  |  |  |
                  |  |  |  +--TRI_VERTEXL          (0x4110) 
                  |  |  |  +--TRI_VERTEXOPTIONS    (0x4111)
                  |  |  |  +--TRI_MAPPINGCOORS     (0x4140) 
                  |  |  |  +--TRI_MAPPINGSTANDARD  (0x4170)
                  |  |  |  +--TRI_FACEL1           (0x4120)
                  |  |  |  |  |
                  |  |  |  |  +--TRI_SMOOTH            (0x4150)   
                  |  |  |  |  +--TRI_MATERIAL          (0x4130)
                  |  |  |  |
                  |  |  |  +--TRI_LOCAL            (0x4160)
                  |  |  |  +--TRI_VISIBLE          (0x4165)
                  |  |  |
                  |  |  +--OBJ_LIGHT    (0x4600)
                  |  |  |  |
                  |  |  |  +--LIT_OFF              (0x4620)
                  |  |  |  +--LIT_SPOT             (0x4610) 
                  |  |  |  +--LIT_UNKNWN01         (0x465A) 
                  |  |  | 
                  |  |  +--OBJ_CAMERA   (0x4700)
                  |  |  |  |
                  |  |  |  +--CAM_UNKNWN01         (0x4710)
                  |  |  |  +--CAM_UNKNWN02         (0x4720)  
                  |  |  |
                  |  |  +--OBJ_UNKNWN01 (0x4710)
                  |  |  +--OBJ_UNKNWN02 (0x4720)
                  |  |
                  |  +--EDIT_UNKNW01  (0x1100)
                  |  +--EDIT_UNKNW02  (0x1201) 
                  |  +--EDIT_UNKNW03  (0x1300)
                  |  +--EDIT_UNKNW04  (0x1400)
                  |  +--EDIT_UNKNW05  (0x1420)
                  |  +--EDIT_UNKNW06  (0x1450)
                  |  +--EDIT_UNKNW07  (0x1500)
                  |  +--EDIT_UNKNW08  (0x2200)
                  |  +--EDIT_UNKNW09  (0x2201)
                  |  +--EDIT_UNKNW10  (0x2210)
                  |  +--EDIT_UNKNW11  (0x2300)
                  |  +--EDIT_UNKNW12  (0x2302)
                  |  +--EDIT_UNKNW13  (0x2000)
                  |  +--EDIT_UNKNW14  (0xAFFF)
                  |
                  +--KEYF3DS (0xB000)
                     |
                     +--KEYF_UNKNWN01 (0xB00A)
                     +--............. (0x7001) ( viewport, same as editor )
                     +--KEYF_FRAMES   (0xB008)
                     +--KEYF_UNKNWN02 (0xB009)
                     +--KEYF_OBJDES   (0xB002)
                        |
                        +--KEYF_OBJHIERARCH  (0xB010)
                        +--KEYF_OBJDUMMYNAME (0xB011)
                        +--KEYF_OBJUNKNWN01  (0xB013)
                        +--KEYF_OBJUNKNWN02  (0xB014)
                        +--KEYF_OBJUNKNWN03  (0xB015)  
                        +--KEYF_OBJPIVOT     (0xB020)  
                        +--KEYF_OBJUNKNWN04  (0xB021)  
                        +--KEYF_OBJUNKNWN05  (0xB022)  
*/

#endif
